package com.masblearn;

public class TankTankColider implements Colider {
    @Override
    public boolean colider(GameObject o1, GameObject o2) {
        if (o1 instanceof Tank && o2 instanceof Tank) {
            Tank t1 = (Tank) o1;
            Tank t2 = (Tank) o2;
            //两个tank相交
            if (t1.rectangle.intersects(t2.rectangle)) {
                t1.back();
                t2.back();
//                t1.stop();
//                return false;
            }
        }
        return true;
    }
}
